package com.jalarbee.stock.category.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jalarbee.core.generic.dao.GenericDao;
import com.jalarbee.core.generic.service.impl.GenericServiceImpl;
import com.jalarbee.core.util.Chunk;
import com.jalarbee.stock.category.business.Category;
import com.jalarbee.stock.category.dao.CategoryDao;
import com.jalarbee.stock.category.service.CategoryService;
import java.util.Set;

@Service(value="categoryService")
@Transactional(readOnly = true)
public class CategoryServiceImpl extends GenericServiceImpl<Category, Integer> implements CategoryService {

	@Autowired
	protected void setDao(@Qualifier (value="categoryDao")GenericDao<Category, Integer> dao) {
		this.dao = dao;
	}
	
	public Set<Category> getAllCategories(Chunk chunk) {
		return ((CategoryDao)dao).getAllCategories();
	}

}